package com.youdoneed.friends.feign;

import com.youdoneed.base.application.ResultMessage;
import com.youdoneed.friends.model.Contact;
import com.youdoneed.friends.vo.AppSearchResult;
import com.youdoneed.friends.vo.ImgComparisonResult;
import com.youdoneed.friends.vo.UserRelationsVO;
import com.youdoneed.user.model.User;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * 说明。
 *
 * @author Ewing
 * @date 2017/4/26
 */
@Component
public class FriendsFallback implements FriendsClient {

    @Override
    public ResultMessage<String> singleRegister(String username, String password) {
        return new ResultMessage<String>().toFailure("RegistrationEasemobFailed");
    }

    @Override
    public ResultMessage<String> getSingleUser(String username) {
        return new ResultMessage<String>().toFailure("调用环信服务：获取环信用户（单个）失败。");
    }

    @Override
    public ResultMessage<String> updateNickName(String username, String nickname) {
        return new ResultMessage<String>().toFailure("调用环信服务：修改环信用户昵称失败。");
    }

    @Override
    public ResultMessage<String> deleteSingleUser(String username) {
        return new ResultMessage<String>().toFailure("调用环信服务：删除单个环信用户失败。");
    }

    @Override
    public ResultMessage<String> addUserFriend(String owner_username, String friend_username) {
        return new ResultMessage<String>().toFailure("调用环信服务：给环信用户添加好友失败。");
    }

    @Override
    public ResultMessage<String> checkUserFriend(String owner_username) {
        return new ResultMessage<String>().toFailure("调用环信服务：查看好友失败。");
    }

    @Override
    public ResultMessage<String> getGroupUser(String limit, String cursor) {
        return new ResultMessage<String>().toFailure("调用环信服务：获取 APP 中所有的群组（可分页）失败。");
    }

    @Override
    public ResultMessage<String> createGroupUser(Map<String, Object> map) {
        return new ResultMessage<String>().toFailure("调用环信服务：创建一个群组失败。");
    }

    @Override
    public ResultMessage<String> deleteGroup(String group_id) {
        return new ResultMessage<String>().toFailure("调用环信服务：删除一个群组失败。");
    }

    @Override
    public ResultMessage<String> addGroupUsers(String chatgroupid, Map<String, Object> map) {
        return new ResultMessage<String>().toFailure("调用环信服务：添加群组成员[批量]失败。");
    }

    @Override
    public ResultMessage<String> getGroupUsers(String group_id) {
        return new ResultMessage<String>().toFailure("调用环信服务：获取群组所有成员失败。");
    }

    @Override
    public ResultMessage<String> deleteGroupUser(String group_id, String username) {
        return new ResultMessage<String>().toFailure("调用环信服务：移出群组成员[单个]失败。");
    }

    @Override
    public ResultMessage<String> addGroupUser(String group_id, String username) {
        return new ResultMessage<String>().toFailure("调用环信服务：添加群组成员[单个]失败。");
    }

    @Override
    public ResultMessage<String> getGroupDetails(@RequestBody List<String> group_ids) {
        return new ResultMessage<String>().toFailure("调用环信服务：获取群组详情失败。");
    }

    @Override
    public ResultMessage<String> modifyGroupDetails(String group_id, String groupname, String description, String maxusers) {
        return new ResultMessage<String>().toFailure("调用环信服务：修改群组信息失败。");
    }

    @Override
    public ResultMessage<List<Map<String, Object>>> findFriendsList(String userId) {
        return new ResultMessage<List<Map<String, Object>>>().toFailure("调用好友服务：根据用户ID查询好友列表失败。");
    }

    @Override
    public ResultMessage<List<User>> findFriends() {
        return new ResultMessage<List<User>>().toFailure("调用好友服务：根据用户ID查询好友列表(news专用)失败。");
    }

    @Override
    public ResultMessage<UserRelationsVO> findFriendIds(Integer type) {
        return new ResultMessage<UserRelationsVO>().toFailure("调用好友服务：根据用户ID查询好友ID列表失败。");
    }

    @Override
    public ResultMessage<String> autoAddFriends() {
        return new ResultMessage<String>().toFailure("调用通讯录服务：后台自动加好友失败。");
    }

    @Override
    public ResultMessage<List<String>> isFriendOrNot(String[] friendIds) {
        return new ResultMessage<List<String>>().toFailure("调用好友服务：后台查询是否好友失败。");
    }

    @Override
    public ResultMessage<ImgComparisonResult> genImgFeature(String pathName, String token) {
        return new ResultMessage<ImgComparisonResult>().toFailure("调用好友服务：人脸特征提取失败。");
    }

    @Override
    public ResultMessage<List<Contact>> getContacts() {
        return new ResultMessage<List<Contact>>().toFailure("调用好友服务：获取用户手机通讯录失败。");
    }

    @Override
    public ResultMessage<AppSearchResult> whoCoolfaceMe(String token) {
        return new ResultMessage<AppSearchResult>().toFailure("调用coolface服务：查询谁coolface我。");
    }
}
